﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:Wpf="clr-namespace:Neos.IdentityServer.MultiFactor.QrEncoding.Windows.WPF">
    <Style TargetType="{x:Type Wpf:QrCodeImgControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Wpf:QrCodeImgControl}">
                    <Border Width="Auto"
                            Height="Auto"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Margin="0">
                        <Image Source="{TemplateBinding WBitmap}"
                           Width="Auto"
                           Height="Auto"
                           HorizontalAlignment="Stretch"
                           VerticalAlignment="Stretch"
                           Margin="0"
                           Stretch="Uniform"></Image>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type Wpf:QrCodeGeoControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Wpf:QrCodeGeoControl}">
                    <Border Width="Auto"
                            Height="Auto"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Margin="0"
                            Background="{TemplateBinding LightBrush}"
                            BorderBrush="{TemplateBinding LightBrush}">
                        <Path Data="{TemplateBinding QrGeometry}"
                              Width="Auto"
                              Height="Auto"
                              HorizontalAlignment="Stretch"
                              VerticalAlignment="Stretch"
                              Stretch="Uniform"
                              Fill="{TemplateBinding DarkBrush}"
                              Margin="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>